package com.jiruan.invoicemanagementsystem.dao.Imp;

import com.jiruan.invoicemanagementsystem.dao.IUserDao;
import com.jiruan.invoicemanagementsystem.pojo.User;
import com.jiruan.invoicemanagementsystem.util.DBHelper;

import java.util.ArrayList;

public class IUserDaoImp implements IUserDao {

    //登录处
    @Override
    public ArrayList<User> LoginAccount(String account) {
        String sql = "select *from user where account=? ";

        ArrayList<User> accountList=DBHelper.currencySqlQuery(User.class, sql, account);

        ArrayList<User> list = new ArrayList<>();
        if (accountList != null) {
            for (Object o : accountList) {
                if (o instanceof User){
                    list.add((User)o);
                }
            }
        }


        return list;
    }
}
